package com.esms.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.esms.dao.AttendanceMapper;
import com.esms.dao.DepartmentMapper;
import com.esms.dao.EmployeeMapper;
import com.esms.po.Attendance;
import com.esms.po.Hassessment;
import com.esms.service.IEmployeeAttendanceServer;

@Service
public class EmployeeAttendanceServerImpl implements IEmployeeAttendanceServer {
	@Autowired
    private AttendanceMapper attendanceMapper = null;
	@Autowired
    private EmployeeMapper employeeMapper = null;
	@Autowired
    private DepartmentMapper departmentMapper = null;
	
    @Override
	public List<Attendance> getEmployeeAttendanceList(String eId,int FdId, String fEid) {
    	if(FdId == 0) {
    		return attendanceMapper.selectBypIdAnddId(eId, fEid);
    	}else {
    		return attendanceMapper.selectBypIdAnddIdAndfEid(eId,FdId,fEid);
    	}
	}
    
    @Override
    public int updateAttendanceList(Attendance attendance) {
         return  attendanceMapper.updateBysId(attendance); 
    
    }
    
    @Override
    public int deleteAttendance(String aAuserid , String aDuserid) {
         return  attendanceMapper.deleteAttendance(aAuserid, aDuserid);
    
    }
    
    @Override
    public int insertAttendance(Hassessment hassessment) {
         return  attendanceMapper.insertAttendance(hassessment); 
    
    }
    public String getDBaccount() {
    	return attendanceMapper.selectByStat(3,1);
    }
}
